package com.cskaoyan.bean.vo;

import lombok.Data;

/**
 * @author: Chunlai
 * @description:
 * @time: 2021/7/12 15:17
 */
@Data
public class CouponBaseVO {

    String errmsg;//告诉前端请求的消息
    long errno;//自己的前后端应用 ： 自定义的状态码 → 通常前端根据该状态码做不同的处理

    public CouponBaseVO() {
    }
    public CouponBaseVO(String errmsg, long errno) {
        this.errmsg = errmsg;
        this.errno = errno;
    }
    public static CouponBaseVO ok(){
        CouponBaseVO couponBaseVO = new CouponBaseVO();
        couponBaseVO.setErrno(0);
        couponBaseVO.setErrmsg("成功");
        return couponBaseVO;
    }
    public static CouponBaseVO over(){
        CouponBaseVO couponBaseVO = new CouponBaseVO();
        couponBaseVO.setErrno(704);
        couponBaseVO.setErrmsg("优惠券已兑换");
        return couponBaseVO;
    }


    public static CouponBaseVO over2(){
        CouponBaseVO couponBaseVO = new CouponBaseVO();
        couponBaseVO.setErrno(704);
        couponBaseVO.setErrmsg("优惠券已经领取过");
        return couponBaseVO;
    }
    public static CouponBaseVO fail(){
        CouponBaseVO couponBaseVO = new CouponBaseVO();
        couponBaseVO.setErrno(742);
        couponBaseVO.setErrmsg("优惠券不正确");
        return couponBaseVO;
    }

}